home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 June / macformat-038.iso / Demos / Interactive Wave / _DATAS / SHARED.Dxr / 00977_Gestion du scroll.ls < prev    next >
Encoding:
Text File  |  1995-08-06  |  2.3 KB  |  73 lines

  1. on LanceScroll Parametres
  2.   global CastEfface
  3.   set SpriteCast1 to getAt(Parametres, 1)
  4.   set SpriteCast2 to SpriteCast1 + 1
  5.   set Xref to the locH of sprite getAt(Parametres, 7)
  6.   set Yref to the locV of sprite getAt(Parametres, 7)
  7.   if getAt(Parametres, 2) = #auto then
  8.     set NumCast1 to the castNum of sprite SpriteCast1
  9.   else
  10.     set NumCast1 to the number of cast getAt(Parametres, 2)
  11.   end if
  12.   set NumCast2 to the number of cast getAt(Parametres, 3)
  13.   set AccuA to getAt(Parametres, 4)
  14.   if AccuA = "Bas" then
  15.     set SignOp to -1
  16.     set AccuS to 1
  17.   else
  18.     if AccuA = "Haut" then
  19.       set SignOp to 1
  20.       set AccuS to 1
  21.     else
  22.       if AccuA = "Droite" then
  23.         set SignOp to -1
  24.         set AccuS to 0
  25.       else
  26.         set SignOp to 1
  27.         set AccuS to 0
  28.       end if
  29.     end if
  30.   end if
  31.   preLoadCast(NumCast2)
  32.   puppetSprite(SpriteCast1, 1)
  33.   puppetSprite(SpriteCast2, 1)
  34.   set the castNum of sprite SpriteCast1 to NumCast1
  35.   set the castNum of sprite SpriteCast2 to NumCast2
  36.   set Dec to 0
  37.   if AccuS = 0 then
  38.     set Taille to (Xref - the locH of sprite (getAt(Parametres, 7) + 1)) * 2
  39.     set DecSprite2 to Taille * -SignOp
  40.     set PasScroll to Taille / (100 / getAt(Parametres, 5)) * SignOp
  41.     set the locV of sprite SpriteCast1 to Yref
  42.     set the locV of sprite SpriteCast2 to Yref
  43.     repeat while abs(Dec) < Taille
  44.       set the locH of sprite SpriteCast1 to Xref + Dec
  45.       set the locH of sprite SpriteCast2 to Xref + DecSprite2 + Dec
  46.       set Dec to Dec + PasScroll
  47.       Interrupt0()
  48.       updateStage()
  49.     end repeat
  50.   else
  51.     set Taille to (Yref - the locV of sprite (getAt(Parametres, 7) + 1)) * 2
  52.     set DecSprite2 to Taille * -SignOp
  53.     set PasScroll to Taille / (100 / getAt(Parametres, 5)) * SignOp
  54.     set the locH of sprite SpriteCast1 to Xref
  55.     set the locH of sprite SpriteCast2 to Xref
  56.     repeat while abs(Dec) < Taille
  57.       set the locV of sprite SpriteCast1 to Yref + Dec
  58.       set the locV of sprite SpriteCast2 to Yref + DecSprite2 + Dec
  59.       set Dec to Dec + PasScroll
  60.       Interrupt0()
  61.       updateStage()
  62.     end repeat
  63.   end if
  64.   set the locH of sprite SpriteCast1 to Xref
  65.   set the locV of sprite SpriteCast1 to Yref
  66.   set the castNum of sprite SpriteCast1 to NumCast2
  67.   set the castNum of sprite SpriteCast2 to CastEfface
  68.   updateStage()
  69.   unLoadCast(NumCast1)
  70.   puppetSprite(SpriteCast2, 0)
  71.   do(getAt(Parametres, 6))
  72. end
  73.